home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8132 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.dcccd.edu!usenet
  2. From: bcalbridge@dcccd.edu (Bob Calbridge)
  3. Newsgroups: comp.lang.c++
  4. Subject: Scope/longevity of class statics
  5. Date: 15 Feb 1996 01:04:12 GMT
  6. Organization: D C C C D
  7. Message-ID: <4fu0qc$1h0@news.dcccd.edu>
  8. NNTP-Posting-Host: user.8.127.dcccd.edu
  9. Mime-Version: 1.0
  10. X-Newsreader: WinVN 0.99.2
  11.  
  12. I know this sounds odd but since things didn't seem to work as
  13. expected I'll put the question to the newsgroup.  I have some
  14. class static data that represents an upper left corner offset
  15. for all display data.  In order to set the value I applied it
  16. to a temporary class object inside a function.  It seemed to
  17. work find for my purposes.  However, when I moved the code that
  18. set the values to another function that was invoked prior to the
  19. original function where it was instigated the values ended up
  20. improperly set by the time I got to my main code.  
  21.  
  22. Does class static data only have scope where the object that
  23. was used to set it has scope?  This doesn't sound right to me
  24. but it seems as if that's the way it's behaving.
  25. -- 
  26. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  27. - Bob Calbridge = Dallas County Community College District  - 
  28. = bcalbridge@dcccd.edu               PC Systems Programmer  =
  29. - Postmaster                                                -
  30. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  31.      Patience is a virtue.  It's not a job requirement.
  32.  
  33.